<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <com></com>
    <com></com>
    <com></com>
</div>
    <com></com>
<script>
    let com = {
        template:`
        <div>
        我的第一个组件 <br>
        <span @click="change">森怕森透,{{num}}</span>
        </div>
        `,
        data: function () {
            return {
                num: '666'
            }
        },
        methods: {
            change(){
                this.num --
            }
        }
    }
    Vue.component('com', com)

    new Vue({
        el: '#app',
        data: {},
    })
</script>
</body>
</html>